##parameters=xml, xml_file

#from Products.KnowledgeEngine.GenericObject import GenericObject

### TODO: Support uploaded files, more formats (i.e. gzip, gzip+uuencode, etc)

if xml_file:
    xml = xml_file.read()
    



context.knowledgeengine_tool.importObjectFromXML( context, xml )


redirect = context.REQUEST.RESPONSE.redirect

return redirect( context.absolute_url() + "?portal_status_message=Object imported" )